<?php
class ControllerModuleNew extends Controller {
	protected function index() {
		$this->language->load('module/new');
		
    	$this->data['heading_title'] = $this->language->get('heading_title');
    	
		$this->load->model('catalog/new');
		
		$this->data['news'] = array();

		foreach ($this->model_catalog_new->getNews() as $result) {
      		$this->data['news'][] = array(
        		'title' => $result['title'],
	    		'href'  => $this->url->link('new/new', 'new_id=' . $result['new_id'])
      		);
    	}

		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/new.tpl')) {
			$this->template = $this->config->get('config_template') . '/template/module/new.tpl';
		} else {
			$this->template = 'default/template/module/new.tpl';
		}
		
		$this->render();
	}
}
?>